#pragma once
#include"RBTree.hpp"

namespace bit
{
template<class K>
class set
{
public:
    class SetKeyOfT
    {
    public:
        const K& operator()(const K& key)
        {
            return key;
        }
    };
    
    
    bool insert(const K& key)
    {
        return _t.Insert(key);
    }
    
    //对类模版取内嵌类型，加typename告诉编译器这里是类型
    typedef typename RBTree<K, K, SetKeyOfT>::iterator iterator;//
    
    iterator begin()
    {
        return _t.begin();
    }
    
    iterator end()
    {
        return _t.end();
    }
    
private:
    RBTree<K,K,SetKeyOfT> _t;
};

}

